﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Phim.aspx.cs" Inherits="LotteCinema.Admin.SanPham" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Import Namespace="LotteCinema.DTO" %>

<%@ Register src="../UserControls/Upload.ascx" tagname="Upload" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="title" style="font-size:14pt;">QUẢN LÝ PHIM</div>
    <asp:panel ID="pnShow" Width="100%" runat="server">
      <table id="table1" 
            style=" border-collapse:collapse; background-color:#D0DEF0; width:100%;" >
            <tr align="center">
                <td>
                    <asp:LinkButton ID="lblphimdangchieu" runat="server" Font-Size="12pt" 
                        Font-Bold="true" ForeColor="#FF6600" onclick="lblphimdangchieu_Click">PHIM ĐANG CHIẾU</asp:LinkButton>
                    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                    <asp:LinkButton ID="lblphimsapchieu" runat="server" Font-Size="12pt" 
                        Font-Bold="true" ForeColor="#FF6600" onclick="lblphimsapchieu_Click1">PHIM SẮP CHIẾU</asp:LinkButton>
                </td>
            </tr>
        <tr>
            <td>
                <asp:Button ID="btnThem" runat="server" Font-Bold="true" CssClass="btnthem" Text="THÊM MỚI" 
                    onclick="btnThem_Click"/>
            </td>
        </tr>
        
        <%--<tr>
            <td class="name_fild_row">Loại Sản Phẩm
                <asp:DropDownList ID="ddlMaLoaiSP" runat="server">
                </asp:DropDownList>
                <asp:Button ID="txtLocSP" runat="server" Text="Lọc Sản Phẩm" 
                    onclick="txtLocSanPham_Click" Height="23px" />
            </td>
        </tr>--%>
    <asp:DataGrid ID="grdPhim" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" CellPadding="3" BorderColor="#CCCCCC" 
            Width="100%" onitemcommand="grdPhim_ItemCommand"  
            OnPageIndexChanged="grdPhim_PhanTrang" BackColor="White" BorderStyle="None" 
            BorderWidth="1px" Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False">
        <HeaderStyle BackColor="#507CD1" Font-Bold="true" ForeColor="White"/>
        <Columns>
            <asp:BoundColumn DataField="maphim" HeaderText="Mã Phim"></asp:BoundColumn>
            <asp:BoundColumn DataField="tenphim" HeaderText="Tên Phim">
                <HeaderStyle Width="100px" />
            </asp:BoundColumn>
            <asp:BoundColumn DataField="namsx" HeaderText="Năm Sản xuất">
             <HeaderStyle Width="30px" />
            </asp:BoundColumn>
            <asp:BoundColumn DataField="maqg" HeaderText="Mã Quốc Gia" Visible="false"><HeaderStyle Width="30px" /></asp:BoundColumn>
            <asp:BoundColumn DataField="tenqg" HeaderText="Tên Quốc Gia"><HeaderStyle Width="30px" /></asp:BoundColumn>
            <asp:BoundColumn DataField="hangphim" HeaderText="Hang Phim"><HeaderStyle Width="50px" /></asp:BoundColumn>
            <asp:BoundColumn DataField="gioithieu" HeaderText="Giới Thiệu">
                <HeaderStyle Width="350px" />
            </asp:BoundColumn>
            <asp:BoundColumn DataField="poster" HeaderText="Poster"></asp:BoundColumn>
            <asp:BoundColumn DataField="Thoiluong" HeaderText="Thời Lượng"><HeaderStyle Width="30px" />
            </asp:BoundColumn>
            <asp:BoundColumn DataField="madd" HeaderText="Mã định dạng" Visible="false"><HeaderStyle Width="30px" /></asp:BoundColumn>
            <asp:BoundColumn DataField="tendd" HeaderText="Tên định dạng"><HeaderStyle Width="30px" /></asp:BoundColumn>
            <asp:BoundColumn DataField="dienvien" HeaderText="Diễn Viên">
                <HeaderStyle Width="100px" />
            </asp:BoundColumn>
            <asp:BoundColumn DataField="Daodien" HeaderText="Đạo Diễn"></asp:BoundColumn>
             <asp:BoundColumn DataField="Thoigiankhoichieu" DataFormatString="{0:d}" HeaderText="Thời Gian Khởi Chiếu"><HeaderStyle Width="50px" /></asp:BoundColumn>
            <asp:BoundColumn DataField="Thoigianngungchieu" DataFormatString="{0:d}" HeaderText="Thời Gian Ngừng Chiếu"><HeaderStyle Width="50px" /></asp:BoundColumn>
            
            <%--<asp:TemplateColumn HeaderText="Hình Ảnh">
                <ItemTemplate>
                    <asp:Image ID="Image1" ImageUrl='<%#Eval("hinhanh") %>' runat="server" Width="100px" Height="75px" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="trangthai" HeaderText="Trạng Thái"></asp:BoundColumn>
            <asp:TemplateColumn HeaderText="Ngày Nhập">
                <ItemTemplate>
                    <%#DateTimeClass.ConvertDateTime(Eval("ngaynhapsp").ToString(),"dd/MM/yyyy") %>
                </ItemTemplate>
            </asp:TemplateColumn>   --%>
            <asp:TemplateColumn>
                <HeaderTemplate>
                    Sữa/Xóa
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="lbtSua" runat="server" 
                        CommandArgument='<%#DataBinder.Eval(Container.DataItem,"maphim")%>' 
                        CommandName="Edit" CssClass="edit" 
                        OnClientClick="return confirm(&quot;Bạn có muốn sữa không ?&quot;)" 
                        ToolTip="Sửa" />
                    |
                    <asp:LinkButton ID="lbtXoa" runat="server" 
                        CommandArgument='<%#DataBinder.Eval(Container.DataItem,"maphim")%>' 
                        CommandName="Delete" CssClass="delete" 
                        OnClientClick="return confirm(&quot;Bạn có chắc chắn muốn xóa không ?&quot;)" 
                        ToolTip="Xóa" />
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
        <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#ff6600" CssClass="trHeder" />
        <ItemStyle ForeColor="#000066" />
        <PagerStyle BackColor="White" ForeColor="#000066" 
                HorizontalAlign="Center" Font-Size="16px"  Mode="NumericPages" />
        <SelectedItemStyle BackColor="#669999" Font-Bold="true" ForeColor="White" />
        </asp:DataGrid>
    </table>
    </asp:panel>
    <asp:Panel ID="pnCapNhat" runat="server">
        <table id="table2" style="border-collapse:collapse" cellpadding="0" width="100%" border="0" >
            <tr>               
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>               
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td width="350" />
                <td width="150" class="name_fild_row">
                    <asp:Label ID="Label1" Text="Tên Phim" runat="server" />
                    <div>&nbsp;</div>
                </td>
                <td>
                    <asp:TextBox ID="txtTenPhim" runat="server" />
                    <asp:RequiredFieldValidator ID="rfvtxtTenPhim" runat="server" 
                        ControlToValidate="txtTenPhim" ErrorMessage="Không được bỏ trống" 
                        ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                    <div >
                        &nbsp;
                    </div>
                </td> 
                               
            </tr>            
            <tr>
                <td width="350" />
                <td width="150" class="name_fild_row">
                    <asp:Label ID="lblChiTiet" Text="Năm sản Xuât" runat="server" />
                    <div>&nbsp;</div>
                </td>
                <td>
                    <asp:DropDownList ID="ddlNam" runat="server" AutoPostBack="True">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvddlNam" runat="server" 
                        ControlToValidate="ddlNam" ErrorMessage="Năm Sản Xuất không được bỏ trống" 
                        ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                    <div>
                        &nbsp;
                    </div>
                </td>
            </tr>
            <caption>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label6" runat="server" Text="Quốc Gia" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlMaQG" runat="server" AutoPostBack="True">
                            <asp:ListItem></asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvddlMaQG" runat="server" 
                            ControlToValidate="ddlMaQG" ErrorMessage="Quốc Gia không được bỏ trống" 
                            ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                        <div>
                            &nbsp;
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td width="150" class="name_fild_row">
                        <asp:Label ID="Label7" Text="Hãng Phim" runat="server" />
                     <div>&nbsp;</div>
                    </td>
                    <td>
                             <asp:TextBox ID="txtHangPhim" runat="server" />
                             <asp:RequiredFieldValidator ID="rfvtxtHangPhim" runat="server" 
                                 ControlToValidate="txtHangPhim" ErrorMessage="Hãng Phim không được bỏ trống" 
                                 ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                         <div>
                             &nbsp;
                         </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td width="150" class="name_fild_row">
                        <asp:Label ID="Label8" Text="Giới Thiệu" runat="server" />
                     <div>&nbsp;</div>
                    </td>
                    <td>
                             <asp:TextBox ID="txtGioiThieu" runat="server" />
                             <asp:RequiredFieldValidator ID="rfvtxtGioiThieu" runat="server" 
                                 ControlToValidate="txtGioiThieu" ErrorMessage="Giới Thiệu không được bỏ trống" 
                                 ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                         <div>
                             &nbsp;
                         </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label4" runat="server" Text="Poster" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <div>
                            <uc1:Upload ID="Upload1" runat="server" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label2" runat="server" Text="Thời Lượng" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:TextBox ID="txtThoiLuong" runat="server" />
                        <asp:RequiredFieldValidator ID="rfvtxtThoiLuong" runat="server" 
                            ControlToValidate="txtThoiLuong" ErrorMessage="Thời Lượng không được bỏ trống" 
                            ForeColor="Red" SetFocusOnError="True" Display="Dynamic">(*)</asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="rvtxtThoiLuong" runat="server" 
                            ControlToValidate="txtThoiLuong" ErrorMessage="Nhập không đúng" ForeColor="Red" 
                            MaximumValue="200" MinimumValue="90" SetFocusOnError="True" Type="Integer" 
                            Display="Dynamic">(*)</asp:RangeValidator>
                        <div>
                            &nbsp;
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label9" runat="server" Text="Định Dạng" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlMaDD" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvddlMaĐ" runat="server" 
                            ControlToValidate="ddlMaDD" ErrorMessage="Định dạng Phim không được bỏ trống" 
                            ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                        <div>
                            &nbsp;
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label3" runat="server" Text="Diễn Viên" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:TextBox ID="txtDienVien" runat="server" />
                        <asp:RequiredFieldValidator ID="rfvtxtDienVien" runat="server" 
                            ControlToValidate="txtDienVien" ErrorMessage="Diễn Viên không được bỏ trống" 
                            ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                        <div>
                            &nbsp;
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label5" runat="server" Text="Đạo Diễn" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:TextBox ID="txtDaoDien" runat="server" />
                        <asp:RequiredFieldValidator ID="rfvtxtDaoDien" runat="server" 
                            ControlToValidate="txtDaoDien" ErrorMessage="Đạo Diễn không được bỏ trống" 
                            ForeColor="Red" SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                        <div>
                            &nbsp;
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="Label10" runat="server" Text="Thời Gian Khởi Chiếu" />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:TextBox ID="txtthoigiankc" runat="server"></asp:TextBox>
                        <asp:CalendarExtender ID="cldngaykhoichieu" runat="server" Enabled="true" TargetControlID="txtthoigiankc" Format="dd/MM/yyyy">
                        </asp:CalendarExtender>
                        <asp:RequiredFieldValidator ID="rfvtxtthoigiankc" runat="server" 
                            ControlToValidate="txtthoigiankc" 
                            ErrorMessage="Thời Gian Khởi Chiếu không được bỏ trống" ForeColor="Red" 
                            SetFocusOnError="True">(*)</asp:RequiredFieldValidator>
                        <div>
                            &nbsp;
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="250" />
                    <td class="name_fild_row" width="150">
                        <asp:Label ID="lblthoigiannc" runat="server" Text="Thời Gian Ngừng Chiếu " />
                        <div>
                            &nbsp;</div>
                    </td>
                    <td>
                        <asp:TextBox ID="txtthoigiannc" runat="server"></asp:TextBox>
                        <asp:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="true" TargetControlID="txtthoigiannc" Format="dd/MM/yyyy">
                        </asp:CalendarExtender>
                        <asp:RequiredFieldValidator ID="rfvtxtthoigiannc" runat="server" 
                            ControlToValidate="txtthoigiannc" 
                            ErrorMessage="Thời Gian Ngừng Chiếu không được bỏ trống" ForeColor="Red" 
                            SetFocusOnError="True" Display="Dynamic">(*)</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" 
                            ControlToCompare="txtthoigiankc" ControlToValidate="txtthoigiannc" 
                            ErrorMessage="Thời Gian Ngừng Chiếu không được nhỏ hơn Thời Gian Khởi Chiếu" 
                            ForeColor="Red" Operator="GreaterThanEqual" Type="Date" Display="Dynamic">(*)</asp:CompareValidator>
                        <div>
                            &nbsp;</div>
                    </td>
                </tr>
                <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                    </td>
                    <td>
                        <asp:LinkButton ID="lbtThem" runat="server" CssClass="btnthem" Font-Size="14px" OnClick="lbtThem_Click"><b>THÊM</b></asp:LinkButton>
                        &nbsp&nbsp&nbsp&nbsp
                        <asp:LinkButton ID="lbtCapNhat" runat="server" CssClass="update" 
                            onclick="lbtCapNhat_Click" Font-Size="14px"><b>CẬP NHẬT</b></asp:LinkButton>
                            &nbsp&nbsp&nbsp&nbsp
                        <asp:LinkButton ID="lblQuayLai" runat="server" CssClass="back" 
                            onclick="lblQuayLai_Click" Font-Size="14px" CausesValidation="False"><b>QUAY LẠI</b></asp:LinkButton>
                    </td>
                </tr>
            </caption>
      </table>
    </asp:Panel>
    <asp:Panel ID="pnThemTheLoaiPhim" runat="server">
            <table id="table3" style="border-collapse:collapse" cellpadding="0" width="100%" border="0" >
            <tr>               
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>               
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td width="350" />
                <td width="150" class="name_fild_row">
                    <asp:Label ID="lbtheloaiphim" Text="Thể Loại Phim" runat="server" />
                    <div>&nbsp;</div>
                </td>
                <td>
                    <asp:DropDownList ID="ddlTheLoaiPhim" runat="server" AutoPostBack="True">
                    </asp:DropDownList>
                    <div >
                        &nbsp;
                    </div>
                </td>              
            </tr>  
            <tr>               
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>               
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                    <td width="350" />
                    <td class="name_fild_row" width="150">
                    </td>
                    <td>
                        <asp:LinkButton ID="lblThemTheLoaiPhim" runat="server" CssClass="btnthem" Font-Size="14px" OnClick="lblThemTheLoaiPhim_Click"><b>THÊM</b></asp:LinkButton>
                        &nbsp&nbsp&nbsp&nbsp
                        <asp:LinkButton ID="lblCapNhatTheLoaiPhim" runat="server" CssClass="update" 
                            Font-Size="14px" onclick="lblCapNhatTheLoaiPhim_Click"><b>CẬP NHẬT</b></asp:LinkButton>
                            &nbsp&nbsp&nbsp&nbsp
                        <asp:LinkButton ID="lblQuayLai1" runat="server" CssClass="back" 
                            onclick="lblQuayLai_Click" Font-Size="14px" CausesValidation="False"><b>QUAY LẠI</b></asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td></td>
                </tr>
            <tr>
                <td width="350" />
                <td width="20" class="name_fild_row">
                    <div>&nbsp;</div>
                </td>
                <td>
                   <asp:DataGrid ID="grdTheLoaiPhim" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="3" BorderColor="#CCCCCC" 
                        Width="100%" onitemcommand="grdTheLoaiPhim_ItemCommand"  
                    BackColor="White" BorderStyle="None" 
                    BorderWidth="1px" Font-Bold="False" Font-Italic="False" 
                    Font-Overline="False" Font-Strikeout="False" Font-Underline="False">
        <HeaderStyle BackColor="#507CD1" Font-Bold="true" ForeColor="White"/>
        <Columns>
            <asp:BoundColumn DataField="maphim" HeaderText="Mã Phim" FooterStyle-Width="30px" Visible="false"></asp:BoundColumn>
            <asp:BoundColumn DataField="matl" HeaderText="Mã Thể Loại" FooterStyle-Width="30px" Visible="false"></asp:BoundColumn>
            <asp:BoundColumn DataField="tenphim" HeaderText="Tên Phim" FooterStyle-Width="30px"></asp:BoundColumn>
            <asp:BoundColumn DataField="tentl" HeaderText="Tên Thể Loại" FooterStyle-Width="30px"></asp:BoundColumn>
            <asp:TemplateColumn>
                <HeaderTemplate>
                    Sữa/Xóa
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="lbtSua" runat="server" 
                        CommandArgument='<%#DataBinder.Eval(Container.DataItem,"maphim")%>' 
                        CommandName="Edit" CssClass="edit" 
                        OnClientClick="return confirm(&quot;Bạn có muốn sữa không ?&quot;)" 
                        ToolTip="Sửa" />
                    <asp:LinkButton ID="lbtXoa" runat="server" 
                        CommandArgument='<%#DataBinder.Eval(Container.DataItem,"maphim")%>' 
                        CommandName="Delete" CssClass="delete" 
                        OnClientClick="return confirm(&quot;Bạn có chắc chắn muốn xóa không ?&quot;)" 
                        ToolTip="Xóa" />
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
        <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" CssClass="trHeder" />
        <ItemStyle ForeColor="#000066" />
        <PagerStyle BackColor="White" ForeColor="#000066" 
                HorizontalAlign="Left" Mode="NumericPages" Font-Underline="True" />
        <SelectedItemStyle BackColor="#669999" Font-Bold="true" ForeColor="White" />
        </asp:DataGrid>
                    <div >
                        &nbsp;
                    </div>
                </td>              
            </tr>  
                
                   
            </table>
    </asp:Panel>
</asp:Content>
